package anim;

import dae.Input;
import dae.Source;

import java.util.List;
import java.util.Map;
import java.util.TreeMap;

public class AnimFragments
{
    public int fps = 30;
    public List <Float> inputs;
    public List <Matrix3D> outputs;
    public List <Interpolation> interpolations;
    public String name;
    public Map <Integer, AnimFragmentStatus> nodeToParentAnimStatusMap = new TreeMap <>();
    public Map <Integer, AnimFragmentStatus> nodeToRootAnimStatusMap = new TreeMap <>();

    public AnimFragments(Input inputInfo, Input outputInfo, Input interpolationInfo, Map <String, Source> sourceMap)
    {
        ParseAnimUtil.initBoneAnimFromAnimClipData(inputInfo, outputInfo, interpolationInfo, this, sourceMap.get(inputInfo.getSource()), sourceMap.get(outputInfo.getSource()), sourceMap.get(interpolationInfo.getSource()));
        for (int i = 0; i < inputs.size(); i++)
        {
            AnimFragmentStatus animFragmentStatus = new AnimFragmentStatus(inputs.get(i), outputs.get(i), interpolations.get(i), fps);
            nodeToParentAnimStatusMap.put(animFragmentStatus.frameId, animFragmentStatus);
        }
    }
}
